<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/mechanica/Mechanica.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/mechanica/Mechanica.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '设备基本信息',
                name: 'mechanica/Mechanica',
                url: "/Mechanica/",
                sortName: "id"
            });
            const editFormFields = ref({"sbmc":"","sbbm":"","sbxh":"","sbtp":"","sl":"","sbrkDate":""});
            const editFormOptions = ref([[{"dataKey":"enable","data":[],"title":"设备名称","field":"sbmc"}],
                              [{"dataKey":"enable","data":[],"title":"设备编码","field":"sbbm","disabled":true}],
                              [{"dataKey":"设备类型2","data":[],"title":"设备型号","field":"sbxh","type":"select"}],
                              [{"dataKey":"enable","data":[],"title":"设备图片","field":"sbtp"}],
                              [{"title":"数量","field":"sl","type":"number"}],
                              [{"title":"设备入库时间","field":"sbrkDate","type":"date"}]]);
            const searchFormFields = ref({"sbmc":"","sbbm":"","sbxh":"","sbtp":"","sbrkDate":""});
            const searchFormOptions = ref([[{"dataKey":"enable","data":[],"title":"设备名称","field":"sbmc","type":"like"},{"dataKey":"enable","data":[],"title":"设备编码","field":"sbbm","type":"like"},{"dataKey":"设备类型2","data":[],"title":"设备型号","field":"sbxh","type":"select"},{"dataKey":"enable","data":[],"title":"设备图片","field":"sbtp","type":"like"},{"title":"设备入库时间","field":"sbrkDate"}]]);
            const columns = ref([{field:'sbmc',title:'设备名称',type:'string',bind:{ key:'enable',data:[]},width:220,align:'left',sort:true},
                       {field:'sbbm',title:'设备编码',type:'string',bind:{ key:'enable',data:[]},width:220,readonly:true,align:'left'},
                       {field:'sbxh',title:'设备型号',type:'string',bind:{ key:'设备类型2',data:[]},width:220,align:'left'},
                       {field:'sbtp',title:'设备图片',type:'string',bind:{ key:'enable',data:[]},width:110,align:'left'},
                       {field:'sl',title:'数量',type:'int',width:80,align:'left'},
                       {field:'sbrkDate',title:'设备入库时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'CreateDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'id',title:'id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "设备图片2",
                table: "Mechanica_records2",
                columns: [{field:'id',title:'id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'sbtp1',title:'图片1',type:'string',width:220,edit:{type:''},align:'left',sort:true},
                       {field:'sbtp2',title:'图片2',type:'string',width:220,edit:{type:''},align:'left'},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'CreateDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'record_id',title:'record_id',type:'int',width:80,hidden:true,readonly:true,require:true,align:'left'}],
                sortName: "record_id",
                key: "record_id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
